<template>
  <div class="app">
    <div class="container ad">
      <nav>
        <div class="logo">
          <img  src="../assets/img/logo1.png" alt="">
        </div>
        <div class="tab">
          <div class="search">
             <img src="../assets/img/sou.png" alt="">
             <input placeholder="搜索" type="text">
           </div>
          <ul>


              <li  v-for="(item,index) in tab" @click='out(index==6)'>
                <router-link :to="item.router"  >
              <img :src="$route.path==item.router?item.src_a:item.src" alt="">
              <span :class="[{active:$route.path==item.router}]">{{item.text}}</span>
              </router-link>
              </li>



          </ul>
        </div>
      </nav>



    <router-view></router-view>









    </div>
  </div>
</template>

<script>
export default {
  name: 'ad',
  data () {
    return {
      tab:[
       {
          src:require('../assets/img/sy.png'),
          src_a:require('../assets/img/sy_a.png'),
          router:'/ad/b_index',
          text:'平台账户管理'
        },
        {
          src:require('../assets/img/ksh.png'),
          src_a:require('../assets/img/ksh_a.png'),
          router:'/ad/ke_info',
          text:'客户信息变更记录'
        },
        {
         src:require('../assets/img/kh.png'),
         src_a:require('../assets/img/kh_a.png'),
         router:'/ad/accss',
          text:'用户访客行为记录'
        },
        {
         src:require('../assets/img/qx.png'),
         src_a:require('../assets/img/qx_a.png'),
         router:'/ad/limit',
          text:'用户权限变更记录'
        },
        {
         src:require('../assets/img/shenpi.png'),
         src_a:require('../assets/img/shenpi_a.png'),
         router:'/ad/apply',
          text:'申请审批授权记录'
        },
        {
         src:require('../assets/img/shezhi.png'),
         src_a:require('../assets/img/shezhi_a.png'),
         router:'/ad/setting',
          text:'平台系统设置'
        },
        {
         src:require('../assets/img/out.png'),
         src_a:require('../assets/img/out_a.png'),
         router:'/',
          text:'退出登录'
        }
      ]
    }
  },
  methods:{
     out(out){
       if(out){
         this.$store.commit('setrole','');
         this.$store.commit('getToken','');
         sessionStorage.setItem('token','');
         sessionStorage.setItem('role','');
       }
     }
  },
  created() {


  },mounted() {



  }
}
</script>

<style scoped>
@import url("../../static/css/ad.css");

</style>
